package com.md.api.dao;

import com.md.api.entity.ShoppingSku;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ShoppingSkuMapper {

    int insert(ShoppingSku record);

    int insertBatch(@Param("skuList")List<ShoppingSku> skuList);

    ShoppingSku getBySkuId(String skuId);

    List<ShoppingSku> initRedisCount();

    int updateStockCount(ShoppingSku sku);
    int updateBase(ShoppingSku sku);

    void skuUpOrDown(@Param("skuId")String skuId,@Param("saleStatus") Integer saleStatus);

    List<ShoppingSku> getBySpuId(@Param("spuId")String spuId);
    List<ShoppingSku> allList(@Param("keyword")String keyword,@Param("shoppingType")Integer shoppingType,
                           @Param("orderType")Integer orderType);
    List<ShoppingSku> list(@Param("keyword")String keyword,@Param("shoppingType")Integer shoppingType,
                           @Param("orderType")Integer orderType);
    int getLowCount(@Param("spuId")String spuId);
    int deleteBySpuId(@Param("spuId")String spuId);
}